package com.bhs.sansong.bean;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

public class LocationBean implements Parcelable {

    private String name;
    private String address;
    private String distance;
    private double latitude;
    private double longitude;
    private String province;
    private String county;
    private String city;


    protected LocationBean(Parcel in) {
        name = in.readString();
        address = in.readString();
        distance = in.readString();
        latitude = in.readDouble();
        longitude = in.readDouble();
        province = in.readString();
        county = in.readString();
        city = in.readString();
        isTick = in.readByte() != 0;
    }

    public static final Creator<LocationBean> CREATOR = new Creator<LocationBean>() {
        @Override
        public LocationBean createFromParcel(Parcel in) {
            return new LocationBean(in);
        }

        @Override
        public LocationBean[] newArray(int size) {
            return new LocationBean[size];
        }
    };

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    private boolean isTick;

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    public boolean isTick() {
        return isTick;
    }

    public void setTick(boolean tick) {
        isTick = tick;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }


    public LocationBean(String name, String address, double latitude, double longitude, String province, String county, String city) {
        this.name = name;
        this.address = address;
        this.latitude = latitude;
        this.longitude = longitude;
        this.province = province;
        this.county = county;
        this.city = city;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel parcel, int i) {
        parcel.writeString(name);
        parcel.writeString(address);
        parcel.writeString(distance);
        parcel.writeDouble(latitude);
        parcel.writeDouble(longitude);
        parcel.writeString(province);
        parcel.writeString(county);
        parcel.writeString(city);
        parcel.writeByte((byte) (isTick ? 1 : 0));
    }
}
